const mongoose = require('mongoose');

mongoose.connect("mongodb+srv://huwei:huwei040729@cluster0.awtd9dt.mongodb.net/test")

const con = mongoose.connection
con.on("open", () => {
    console.log("连接数据库成功");
})
con.on("error", err => {
    console.log("数据库连接失败", err);
})
module.exports = mongoose
